package com.atguigu.tingshu.album.config;

import io.minio.MinioClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author xiaoxu
 * @description:
 * @date 2024/08/23 07:19
 **/
@Configuration
@SuppressWarnings("all")
public class MinioConfig {
    @Autowired
    private MinioConstantProperties props;

    @Bean
    public MinioClient minioClient() {
        return MinioClient.builder()
                //操作MinIO地址 端口9000
                .endpoint(props.getEndpointUrl())
                .credentials(props.getAccessKey(), props.getSecretKey())
                .build();
    }

}
